

<template>
<div class="model-use">
  <div>Parent bound v-model is: {{ childCount }}</div>
  <div>Parent bound v-model:flag is: {{ childFlag }}</div>
  <button @click="updateCount">Increment</button>
  <button @click="updateFlag">改变flag</button>
</div>
</template>
<script setup lang="ts">
const childCount = defineModel({required:true})
const childFlag = defineModel('dialogFlag')
const updateCount = ()=>{
  (childCount.value as number)++
}
const updateFlag = ()=>{
  childFlag.value = !childFlag.value
}
</script>
<style scoped>

</style>
